<?php

/**
 * TypeJour filter form base class.
 *
 * @package    sop
 * @subpackage filter
 * @author     Your name here
 */
abstract class BaseTypeJourFormFilter extends BaseFormFilterPropel
{
  public function setup()
  {
    $this->setWidgets(array(
      'libelle'               => new sfWidgetFormFilterInput(),
      'default_duree'         => new sfWidgetFormFilterInput(),
      'is_oblig_duree'        => new sfWidgetFormFilterInput(),
      'is_default_jour_ouvre' => new sfWidgetFormFilterInput(),
      'is_default_we'         => new sfWidgetFormFilterInput(),
      'is_only_duree'         => new sfWidgetFormFilterInput(),
      'is_credit'             => new sfWidgetFormFilterInput(),
      'is_deplact'            => new sfWidgetFormFilterInput(),
    ));

    $this->setValidators(array(
      'libelle'               => new sfValidatorPass(array('required' => false)),
      'default_duree'         => new sfValidatorSchemaFilter('text', new sfValidatorInteger(array('required' => false))),
      'is_oblig_duree'        => new sfValidatorSchemaFilter('text', new sfValidatorInteger(array('required' => false))),
      'is_default_jour_ouvre' => new sfValidatorSchemaFilter('text', new sfValidatorInteger(array('required' => false))),
      'is_default_we'         => new sfValidatorSchemaFilter('text', new sfValidatorInteger(array('required' => false))),
      'is_only_duree'         => new sfValidatorSchemaFilter('text', new sfValidatorInteger(array('required' => false))),
      'is_credit'             => new sfValidatorSchemaFilter('text', new sfValidatorInteger(array('required' => false))),
      'is_deplact'            => new sfValidatorSchemaFilter('text', new sfValidatorInteger(array('required' => false))),
    ));

    $this->widgetSchema->setNameFormat('type_jour_filters[%s]');

    $this->errorSchema = new sfValidatorErrorSchema($this->validatorSchema);

    parent::setup();
  }

  public function getModelName()
  {
    return 'TypeJour';
  }

  public function getFields()
  {
    return array(
      'libelle'               => 'Text',
      'default_duree'         => 'Number',
      'is_oblig_duree'        => 'Number',
      'is_default_jour_ouvre' => 'Number',
      'is_default_we'         => 'Number',
      'is_only_duree'         => 'Number',
      'is_credit'             => 'Number',
      'is_deplact'            => 'Number',
      'id'                    => 'Number',
    );
  }
}
